package com.java2108.user.kafka;


import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

@Slf4j
//@Component
public class TestConsumer {

    @KafkaListener(topics = {"test", "test1"})
    public void consumer(ConsumerRecord<String, String> consumerRecord) {
        String key = consumerRecord.key();
        String msg = consumerRecord.value();
        log.info("key:{},msg:{}", key, msg);
    }


}
